package com.isunland.managesystem.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.TextView;
import com.isunland.managesystem.base.BaseArrayDialogFragment;
import com.isunland.managesystem.entity.PayWay;
import java.util.ArrayList;

/**
 * 对象功能:
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: wangyanan
 * 创建时间: 2016/12/28 16:17
 */

public class PayWayDialogFragment extends BaseArrayDialogFragment<PayWay> {
  private ArrayList<PayWay> mPayWayList;

  public static PayWayDialogFragment newInstance(ArrayList<PayWay> data) {
    if (data == null) return null;
    Bundle bundle = new Bundle();
    bundle.putSerializable(EXTRA_VALUE, data);
    PayWayDialogFragment fragment = new PayWayDialogFragment();
    fragment.setArguments(bundle);
    return fragment;
  }

  @Override protected ArrayList<PayWay> initData() {
    return mPayWayList;
  }

  @Override public void bindData(PayWay object, TextView tv) {
    tv.setText(object.getName());
  }

  @SuppressWarnings("unchecked") @Override
  public void onCreate(@Nullable Bundle savedInstanceState) {

    mPayWayList = (ArrayList<PayWay>) getArguments().getSerializable(EXTRA_VALUE);
    super.onCreate(savedInstanceState);
  }
}
